import { Toast } from 'vant'

const utils = {
  isBigScreen: function () {
    let result = false;
    let isIos =
      !!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/) == true
        ? "ios"
        : "android";
    if (isIos) {
      const rate = window.screen.height / window.screen.width;
      let limit =
        window.screen.height == window.screen.availHeight ? 1.8 : 1.65; // 临界判断值
      if (rate > limit) {
        result = true;
      }
    }
    return result;
  },
  ui: {
    Toast: (msg:string) => {
      Toast(msg)
    }
  }
}

export default utils